# 编译器设置
CC = arm-linux-gcc
CFLAGS = -Wall -O2
INCLUDES = -I ~/libpng/install/include -I ~/zlib/install/include -I ~/libjpeg/include
LIBS = -L ~/libpng/install/lib -L ~/zlib/install/lib -L ~/libjpeg/lib -lpng -lz -ljpeg -lm -static

# 源文件和目标文件
SOURCES = main.c ui.c touch.c png.c bmp.c jpeg.c album.c music.c video.c
TARGET = main

# 默认目标
all: $(TARGET)

# 编译目标
$(TARGET): $(SOURCES)
	$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)

# 清理
clean:
	rm -f $(TARGET)

# 安装到开发板（需要根据实际情况修改路径）
install:
	scp $(TARGET) root@192.168.1.100:/home/root/

# 运行（在开发板上）
run:
	./$(TARGET)

# 帮助信息
help:
	@echo "可用目标:"
	@echo "  all     - 编译程序"
	@echo "  clean   - 清理编译文件"
	@echo "  install - 安装到开发板"
	@echo "  run     - 运行程序"
	@echo "  help    - 显示帮助信息"

.PHONY: all clean install run help 